package com.dimples.dd.system.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dimples.dd.mybatis.core.dataobject.BaseDO;
import com.dimples.dd.system.core.enums.MenuTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 菜单权限表
 */
@Schema(description = "菜单权限表")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "system_menu")
public class SystemMenuDO extends BaseDO {
    /**
     * 菜单ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "菜单ID")
    private Long id;

    /**
     * 菜单名称
     */
    @TableField(value = "menu_name")
    @Schema(description = "菜单名称")
    private String menuName;

    /**
     * 权限标识
     */
    @TableField(value = "permission")
    @Schema(description = "权限标识")
    private String permission;

    /**
     * 菜单类型
     * {@link MenuTypeEnum}
     */
    @TableField(value = "menu_type")
    @Schema(description = "菜单类型")
    private Integer menuType;

    /**
     * 显示顺序
     */
    @TableField(value = "sort")
    @Schema(description = "显示顺序")
    private Integer sort;

    /**
     * 父菜单ID
     */
    @TableField(value = "parent_id")
    @Schema(description = "父菜单ID")
    private Long parentId;

    /**
     * 父节点路径
     */
    @TableField(value = "tree_path")
    @Schema(description = "父节点路径")
    private String treePath;

    /**
     * 菜单图标
     */
    @TableField(value = "icon")
    @Schema(description = "菜单图标")
    private String icon;

    /**
     * 图标类型(1:iconify;2:local)
     */
    @TableField(value = "icon_type")
    @Schema(description = "菜单图标(1:iconify;2:local)")
    private Integer iconType;

    /**
     * 组件路径
     */
    @TableField(value = "component")
    @Schema(description = "组件路径")
    private String component;

    /**
     * 路由名称
     */
    @TableField(value = "route_name")
    @Schema(description = "路由名称")
    private String routeName;

    /**
     * 组件名
     */
    @TableField(value = "route_path")
    @Schema(description = "路由路径")
    private String routePath;

    /**
     * 外链
     */
    @TableField(value = "href")
    @Schema(description = "外链")
    private String href;

    /**
     * 外链打开方式(1:内部;2:新窗口)
     */
    @TableField(value = "href_open_type")
    @Schema(description = "外链打开方式(1:内部窗口打开;2:浏览器窗口打开)")
    private Integer hrefOpenType;

    /**
     * 菜单状态
     */
    @TableField(value = "`status`")
    @Schema(description = "菜单状态")
    private Integer status;

    /**
     * i18nKey
     */
    @TableField(value = "i18n_key")
    @Schema(description = "i18nKey")
    private String i18nKey;

    /**
     * 是否可见
     */
    @TableField(value = "hide_in_menu")
    @Schema(description = "是否可见")
    private Boolean hideInMenu;

    /**
     * 进入该路由时激活的菜单键
     */
    @TableField(value = "active_menu")
    @Schema(description = "进入该路由时激活的菜单键")
    private String activeMenu;

    /**
     * 是否缓存
     */
    @TableField(value = "keep_alive")
    @Schema(description = "是否缓存")
    private Boolean keepAlive;

    /**
     * 是否为常量路由
     */
    @TableField(value = "constant")
    @Schema(description = "是否为常量路由")
    private Boolean constant;

    /**
     * 支持多页签
     */
    @TableField(value = "multi_tab")
    @Schema(description = "支持多页签")
    private Boolean multiTab;

    /**
     * 固定在页签中的序号
     */
    @TableField(value = "fixed_index_in_tab")
    @Schema(description = "固定在页签中的序号")
    private Integer fixedIndexInTab;

    /**
     * 是否总是显示
     */
    @TableField(value = "always_show")
    @Schema(description = "是否总是显示")
    private Boolean alwaysShow;
}